using System;

using octalforty.BizFramework.Core;

namespace octalforty.Waffle.ObjectModel.Business.Objects
{
    /// <summary>
    /// Represents a single post within a <see cref="Discussion"/>.
    /// </summary>
    public class DiscussionPost : BusinessObjectBase, IBusinessObjectWithVersionTag
    {
        #region Private Member Variables
        private long versionTag;
        private Discussion discussion;
        private User author;
        private DateTime publishedOn = DateTime.Now;
        private string content;
        #endregion

        #region Public Properties
        /// <summary>
        /// Gets or sets a reference to the <see cref="Objects.Discussion"/> this
        /// <see cref="DiscussionPost"/> belongs to.
        /// </summary>
        public virtual Discussion Discussion
        {
            get { return discussion; }
            set { discussion = value; }
        }

        /// <summary>
        /// Gets or sets a reference to the <see cref="User"/> who is the
        /// author of this <see cref="DiscussionPost"/>.
        /// </summary>
        public virtual User Author
        {
            get { return author; }
            set { author = value; }
        }

        /// <summary>
        /// Gets or sets a <see cref="DateTime"/> which contains the date
        /// and time this <see cref="DiscussionPost"/> was published.
        /// </summary>
        public virtual DateTime PublishedOn
        {
            get { return publishedOn; }
            set { publishedOn = value; }
        }

        /// <summary>
        /// Gets or sets a string which contains the actual content of this
        /// <see cref="DiscussionPost"/>.
        /// </summary>
        public virtual string Content
        {
            get { return content; }
            set { content = value; }
        }
        #endregion

        /// <summary>
        /// Initializes a new instance of <see cref="DiscussionPost"/> class.
        /// </summary>
        public DiscussionPost()
        {
        }

        #region IBusinessObjectWithVersionTag Members
        /// <summary>
        /// Gets or sets business object version tag.
        /// </summary>
        public virtual long VersionTag
        {
            get { return versionTag; }
            set { versionTag = value; }
        }
        #endregion
    }
}
